//
//  HomeViewController.h
//  ActiveDeck
//
//  Created by BigChicken on 1/25/11.
//  Copyright 2011 __MyCompanyName__. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "GDataXMLNode.h"
#import "LoginViewController.h"
#import "CustomMovieViewController.h"
#import "Reachability.h"
#import "AD_Environment.h"

@class Init;

@interface HomeViewController : UIViewController <UIAlertViewDelegate ,UITableViewDelegate, UITableViewDataSource, UITextFieldDelegate, CustomMovieDelegate>{
    
    IBOutlet UIView *loadingView;
    IBOutlet UIImageView *IUV_DarkOverlay;
	IBOutlet UILabel *greeting;
    IBOutlet UILabel *approval;
    IBOutlet UILabel *Lb_PID;
	
	IBOutlet UITextField *presentID;
	IBOutlet UIProgressView *progressBar;
    IBOutlet UIButton *Bt_Logout;
	IBOutlet UIButton *Bt_Go;
    IBOutlet UIButton *Bt_Cancel;
    IBOutlet UIButton *Bt_ShowVersion;
    IBOutlet UIButton *Bt_About;
    
    IBOutlet UILabel *Lab_PresentName;
    IBOutlet UIImageView *ImgV_Icon;
    
    
    IBOutlet UITableViewCell *PIDTableCell;
    IBOutlet UITableView *PIDTable;
    NSMutableArray *Arr_PID;
    
    LoginViewController *loginVC;
    NSString *ErrorLogText;
    
	Init *initOB;
	GDataXMLElement *AuthNode;
    NSString *cont_Username;
	NSString *loginXML;
    NSString *presentName;
	id _delegate;
    
    NSTimer *avaibleTimer;
    
    CustomMovieViewController *cmvc;
    
    UIView *blockedView;
    
    IBOutlet UIButton *Bt_CancelBlocked;
    
    IBOutlet UILabel *Username_Label;
    IBOutlet UIImageView *loggedInBar;
        
    BOOL TABLEHIDE;
    
    AD_Environment *environment;
    
    BOOL hasInternet;
    //    Reachability * internetReachable;
    //    Reachability * hostReachable;
    //    BOOL internetActive;
    
}
//@property (readwrite) BOOL internetActive;
//@property (nonatomic , retain)  Reachability * internetReachable;
//@property (nonatomic , retain) Reachability * hostReachable;
@property (readwrite) BOOL TABLEHIDE;
@property (nonatomic, retain) NSString *cont_Username;
@property (nonatomic, retain) UILabel *Lb_PID;
@property (nonatomic, retain) UIImageView *IUV_DarkOverlay;
@property (nonatomic, retain) UIView *loadingView;
@property (nonatomic, retain) NSString *ErrorLogText;
@property (nonatomic, retain) NSTimer *avaibleTimer;

@property (nonatomic, retain) IBOutlet UITableViewCell *PIDTableCell;
@property (nonatomic, retain) IBOutlet UITableView *PIDTable;
@property (nonatomic, retain) NSMutableArray *Arr_PID;
@property (nonatomic, retain) NSString *presentName;

@property (nonatomic, retain) IBOutlet UILabel *approval;
@property (nonatomic, retain) LoginViewController *loginVC;
@property (nonatomic, retain) NSString *loginXML;
@property (nonatomic, retain) GDataXMLElement *AuthNode;
@property (nonatomic, retain) Init *initOB;
@property (nonatomic, retain) IBOutlet UITextField *presentID;
@property (nonatomic, retain) IBOutlet UIProgressView *progressBar;

@property (nonatomic, retain) IBOutlet UILabel *greeting;
@property (nonatomic, retain) IBOutlet UIButton *Bt_Logout;
@property (nonatomic, retain) IBOutlet UIButton *Bt_Go;
@property (nonatomic, retain) IBOutlet UIButton *Bt_Cancel;
@property (nonatomic, retain) IBOutlet UIButton *Bt_ShowVersion;
@property (nonatomic, retain) IBOutlet UILabel *Lab_PresentName;
@property (nonatomic, retain) IBOutlet UIImageView *ImgV_Icon;
@property (nonatomic, retain) IBOutlet UIButton *Bt_About;

@property (nonatomic, retain) CustomMovieViewController *cmvc;
@property (nonatomic, retain) UIView *blockedView;
@property (nonatomic, retain) IBOutlet UIButton *Bt_CancelBlocked;
@property (nonatomic, retain) IBOutlet UILabel *Username_Label;
@property (nonatomic, retain) IBOutlet UIImageView *loggedInBar;

@property (nonatomic, retain) AD_Environment *environment;
@property (readwrite) BOOL hasInternet;
-(void)updatePIDList;


-(IBAction) updatePrefs:(id)sender;
-(IBAction) DownloadPresentation;
-(IBAction) showInfo:(id)sender;
-(IBAction) userLogout;
-(IBAction) cancelDownload;
-(IBAction) showVersion;
-(IBAction)showAbout:(id)sender;

- (void)ScanLogForError;
- (void)hideAll:(BOOL)shouldHide;
- (id)delegate;
- (void)setDelegate:(id)delegate;
- (void)GetPresentInfo:(int)PID;
- (void)BuildAnonymousXMLAuth;
- (void)DownloadPresentationInBackground;
- (void)InitializeOB:(NSString*)PID;
- (void)DisplayWaiting:(BOOL)display;
- (void)postErrorToWeb;
- (BOOL)AutoUpdateCheck;
- (NSString*)FetchPInfo:(int)PID;
- (void)readyMoviePlayer;
- (IBAction)hideBlockedWindow:(id)sender;
//- (void) checkNetworkStatus:(NSNotification *)notice;


@end

@interface NSObject(SlideConfigDelegate)
- (void)InitialSlideSession;
- (void)ShowCamera;

@end
